/*
 * =====================================================================================
 *
 *       Filename:  main.c
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  05/08/12 14:37:32
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  YOUR NAME (), 
 *        Company:  
 *
 * =====================================================================================
 */
#include <unistd.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char** argv)
{
    int ret = 0;
    opterr = 0;
    while ((ret = getopt(argc, argv, "a:bh:")) != -1)
    {
        if (ret == '?')
            printf("unknow parameter\n");
        else
            printf("-%c parameter %s\n", ret, (optarg && (strlen(optarg) > 0)) ? optarg : "not needed");
    }
    printf("\n\n");
    return 0;
}
